1. Field of the Invention
This invention relates generally to image processing, and more particularly to a hardware system and method for rotating an image for portrait-oriented display.
2. Description of the Background Art
Computer systems store images in a bitmap format. Bitmaps are organized so that a display controller can read a sequence of bits corresponding to a picture element (pixel) and transfer the sequence to a display for pixel rendition. The display controller repeats this process for successive pixels until an entire image is displayed.
Organization of a bitmap defines image dimensions and image orientation, i.e. portrait or landscape. An image is portrait-oriented if its height is greater than its width, and landscape-oriented if its width is greater than its height. FIG. 1(a) depicts a landscape-oriented image bitmap. The width (W.sub.I) of the image is greater than its height (H.sub.I). FIG. 2(a) depicts a portrait-oriented image bitmap. H.sub.I is greater than W.sub.I . The arrows in both corresponding FIGS. 1(a) and 2(a) illustrate software addressing patterns in which pixels are typically stored to bitmap storage.
To maximize the duty cycle of the display, i.e. to minimize the period of time between successive refresh cycles of a given scan line, display devices such as Cathode Ray Tubes (CRTs) or Liquid Crystal Displays (LCDs) are typically landscape-configured. That is, display devices have physical address schemes which cause pixels to be refreshed in a landscape-oriented pattern. As can be seen by the arrows in FIG. 1(b), the typical landscape-oriented display is refreshed starting at the top left corner, and continuing rightward across the first row and downward through the rows.
For some computer systems or applications, it is desirable to have a portrait-oriented display. In such a system, the CRT or LCD would be physically rotated ninety degrees. The arrows in FIG. 2(b) illustrate that, for the physically rotated display, the refresh address scheme is still landscape-oriented beginning at the original pixel location (rotated ninety degrees counter-clockwise to the bottom left corner now) and continuing in the same order.
The software addressing pattern depicted in FIG. 1 (a) is the same as the physical address pattern depicted in FIG. 1(b), so landscape-oriented software addresses to landscape-oriented physical addresses do not need to be translated. However, the software addressing pattern depicted in FIG. 2(a) is not the same as the physical address pattern depicted in FIG. 2(b). Thus, portrait-oriented image addresses need translation to a physical address for a portrait-oriented landscape-configured display.
The prior art rotates an image ninety degrees using a program or a special driver to translate software addresses to physical addresses. When the typical rotation program is instructed to draw a bitmap sequence, the program first performs software translation operations to determine new pixel coordinates when rotated 90.degree., and then performs the drawing operation using those translated coordinates. In some particular drawing operations, additional software may be necessary to treat the rotated drawing as a "special case." For example, to draw text characters in a rotated graphics display would require retrieving the bitmapped font pixels from font storage in a rotated orientation rather than the normal byte-wise unrotated orientation in which the font data is stored. This may require several additional memory cycles to retrieve this rotated bitmapped font data for just a single line of a given character. In general, the large number of additional read and translation operations for any drawing operation to rotate an image consumes substantial computer processing resources and time. These problems are compounded when rotating larger or more complex images. Therefore, a system is needed to rotate an image for portrait-oriented display without using inefficient software programming or impeding refresh operations.